package com.mouse.dnf;

import com.mouse.damo.micro.Com;
import com.mouse.damo.micro.FindPic;
import com.mouse.damo.micro.Sleep;
import com.mouse.damo.service.Point;

import java.util.HashSet;
import java.util.Set;

public class Test {
    public static void main(String[] args) {
        Com com = new Com();
        com.setResourcePath("D:\\dnf");
        com.bind(925632);
        FindPic findPic = new FindPic(com);
        Set<Integer> xList = new HashSet<>(), yList = new HashSet<>();
        Set<Integer> bossXList = new HashSet<>(), bossYList = new HashSet<>();
        while (true) {
            int[] ff00ffs = findPic.findPic(0, 0, 1000, 800, "头像1.bmp|头像2.bmp",
                    "203040", 0.9, 0);
            System.out.println(new Point(ff00ffs));
            int[] ff00ffs2 = findPic.findPic(0, 0, 1000, 800, "问号0.bmp|问号1.bmp|问号2.bmp|问号3.bmp|问号4.bmp",
                    "203040", 1, 0);
            System.out.println(new Point(ff00ffs2));

            int[] ff00ffs3 = findPic.findPic(0, 0, 1000, 800, "boss.bmp|boss2.bmp",
                    "203040", 0.9, 0);
            System.out.println(new Point(ff00ffs3));
            if (ff00ffs2[0] != -1) {
                xList.add(Math.abs(ff00ffs[1] - ff00ffs2[1]));
                yList.add(Math.abs(ff00ffs[2] - ff00ffs2[2]));
            } else {
                bossXList.add(Math.abs(ff00ffs3[1] - ff00ffs[1]));
                bossYList.add(Math.abs(ff00ffs3[2] - ff00ffs[2]));
            }
            System.out.println(xList);
            System.out.println(yList);
            System.out.println(bossXList);
            System.out.println(bossYList);
            System.out.println();
            Sleep.sleep(5000);
        }
    }
}
